package com.jy.dao;


import com.jy.entity.*;

import java.sql.SQLException;
import java.util.List;

public interface ManageDao {
    //登录
    public Admin login(String name,String pass)throws Exception;
    //注册
    public int add(Admin obj)throws  Exception;
    //找回密码
    public Admin pwd(String name,String phone)throws Exception;
    //修改密码
    public  int update(Admin obj)throws  Exception;
    //查询是否有该管理员
    public List<Admin> getyh(String name) throws SQLException;

    /**
     * 查询考试记录的行数
     * @return
     * @throws SQLException
     */
    public int logcount() throws SQLException;

    /**
     * 删除考试记录
     * @param id  考试记录的ID
     * @return
     * @throws SQLException
     */
    public int detestlog(int id) throws SQLException;

    /**
     * 分页查询
     * @param sat
     * @param end
     * @return
     * @throws SQLException
     */
    public List findsell(int sat,int end) throws SQLException;

    /**
     * 模糊搜索考试记录
     * @param name 姓名
     * @return
     * @throws SQLException
     */
    public List search(int sat,int end,String name) throws SQLException;

    /**
     * 查询模糊搜索的总条数
     * @param name 搜索的name
     * @return
     * @throws SQLException
     */
    public int seacount(String name) throws SQLException;


    //查询题库分类
    public List<book> getbook(String sql, Object... objects) throws SQLException ;
    //查询题库分类放入实体类
    public book getbook2(String sql, Object... objects) throws SQLException;
    //查询登陆的学生id
    public Student getstuid(String stname) throws SQLException ;
    //分页查询考试
    public List<ExamCenter> getexamcenter(int sat,int end) throws  SQLException;
    /**
     * 模糊搜索考试
     * @param name 姓名
     * @return
     * @throws SQLException
     */
    public List findexam_name(int sat,int end,String name) throws SQLException;
    //根据id删除考试
    public int delexam(int id) throws SQLException;

    //分页查询教学视频
    public List getstuvideo(String sql,Object... objects) throws  SQLException;
    //分页查询班级视频
    public List getclsvideo(String sql,Object... objects) throws  SQLException;
    //根据id删除视频
    public int delvideo(int id) throws SQLException;
    //修改考试记录状态
    public int updaterecord(int id)throws SQLException;
    //添加考试
    public int addtest(Timetest t) throws SQLException;
    //修改考试
    public int updatetest(Timetest t) throws SQLException;
    //实体类接收查询试卷
    public Timetest getTimetest(String sql,Object... objects) throws  SQLException;
    //查询试卷题目
    public List<Question> gettestquestion(String sql,Object... objects) throws SQLException;
    //查询题目放入实体类
    public  Question getquestion(String sql,Object... objects)throws SQLException;
    //查询视频
    public List<Video> getvideo(String sql,Object... objects)throws SQLException;
    //添加视频
    public int addvideo(Video v)throws SQLException;

    //添加题植入错题本
    public int addfalsebook(FalseBook fb)throws SQLException;

    //查错题本
    public List falsebook(String sql,Object... objects)throws SQLException;

    //获取数量
    public int getstucount(String sql,Object... objects)throws SQLException;
    //根据试卷id进行分数排名
    public List orderbyscore(String sql,Object... objects) throws SQLException;
    //根据错题本中题目出现的次数进行错题排名
    public List orderbyfalse(String sql,Object... objects)throws SQLException;

    //考试记录:查询所有班级
    public List cxsybj/*查询所有班级*/() throws SQLException ;
    //考试记录:查询单个班级加入下拉框
    public List<exam_record> cxsysj/*查询所有试卷*/() throws SQLException ;
    //考试情况:班级查询考试情况
    public List cxksbj/*查询考试班级*/(String sql/*,int limit, int size,Object... param*/) throws SQLException ;
    //考试情况:试卷查询考试情况
    public List<exam_record> cxkssj/*查询考试试卷*/(String exam_name) throws SQLException ;
    //考试情况:删除试卷
    public int delsj(int exam_record_id) throws SQLException ;
    //查行数
    public int getCount(String sql,Object... param)throws Exception;
    //查询老师信息
    public List getPage(int p)throws Exception;
    //查询行数
    public int count()throws Exception;
    //模糊查询
    public List find(String tname)throws Exception;
    public List find2(String job )throws Exception;
    //删除
    public int delete(Teacher obj)throws  Exception;
    //添加
    public  int add(Teacher obj)throws Exception;
    //修改
    public  int update(Teacher obj)throws Exception;
    //判断是否存在该老师
    public List<Teacher> getls(String name) throws SQLException;
    /**
     * 根据评论表删除留言
     * @param cid
     * @returnc
     */
    public int delreqly(String cid);

    /**
     * 分页模糊查询评论表用户
     * @param page
     * @param limit
     * @param uname
     * @return
     */
    public List queryall(int page,int limit,String uname);
    //分页查询所有问题
    public List findquestionspage(String sql,Object... objects);
    //根据id删除题目
    public int delquestion(int id) throws SQLException;

    /**
     * 统计模糊查询评论表数量
     * @param uname
     * @return
     */
    public int getcount(String uname);

    /**
     * 删除评论
     * @param cid
     * @return
     */
    public int delcomment(String cid);

    //新增考题
    public int addquestion(Question question) throws Exception;
    //查询书籍id
    public List getbookid(String bookname) throws Exception;
    //修改老师注册码
    public int lszcmpdate(register obj)throws Exception;
    //修改学生注册码
    public int xszcmpdate(register obj)throws Exception;


    //查询学生信息
    public List getstuPage(int p)throws Exception;
    //查询学生信息行数
    public int stucount()throws Exception;
    //模糊查询学生信息
    public List findstu(String stname)throws Exception;
    //删除
    public int deletestu(Student obj)throws  Exception;
    //添加
    public  int addstu(Student obj)throws Exception;
    //修改
    public  int updatestu(Student obj)throws Exception;
    //判断是否存在该学生
    public List<Student> getstu(String name) throws SQLException;
    //寻找学生
    public List<Student> findstu2(String stname) throws SQLException ;

    /**
     * 修改班级考试
     * @param
     * @param ts 考试实体类
     * @return
     * @throws SQLException
     */
    public int upexam(Timetest ts) throws SQLException;
    //修改时段试卷
    public int uptimeexam(Timetest ts) throws SQLException;
    //修改固定试卷
    public int upgdexam(Timetest ts) throws SQLException;

    //修改问题
    public int upquestion(Question q) throws SQLException;
}
